<?php
/**
 * @package panel
 * @subpackage panel.exceptions
 */
/**
 * Validation exception
 * @author Dmitry Bakaleinik (code)
 */
class panel__e__validation
	extends panel__e__exception
	implements panel__e__i_displayable_to_user {

	protected $message   = "Validation failed: %s%s%s";
	protected $displayID = 500;

	public function __construct($_field_ = "", $_value_ = NULL, $_message_ = NULL) {

		$this->message = sprintf(
			$this->message,
			$_field_,
			( !empty($_value_) ? (" value " . var_export($_value_, true)) . " " : " "),
			isset_or($_message_, "")
		);

		if( panel__settings__environment::isVerbose() ) {
			$this->message = $this->__toString(); }

	}	# Function

}	# Class

/* EOF */